﻿using RpcHelper.Validate;

namespace Wedonek.RpcStore.Service.Model
{
        /// <summary>
        /// 任务项修改
        /// </summary>
        public class SetTaskItem
        {
                /// <summary>
                /// 任务项标题
                /// </summary>
                [NullValidate ("rpc.task.item.title.null")]
                [LenValidate ("rpc.task.item.title.len",2,50)]
                public string ItemTitle
                {
                        get;
                        set;
                }
                /// <summary>
                /// 排序位
                /// </summary>
                [NumValidate ("rpc.task.item.sort.error",0)]
                public int ItemSort
                {
                        get;
                        set;
                }
                /// <summary>
                /// 发送类型
                /// </summary>
                [EnumValidate ("rpc.task.item.sendType.error", typeof(TaskSendType))]
                public TaskSendType SendType
                {
                        get;
                        set;
                }
                /// <summary>
                /// 发送参数
                /// </summary>
                [NullValidate ("rpc.task.item.send.param.null")]
                public TaskSendParam SendParam
                {
                        get;
                        set;
                }
                /// <summary>
                /// 超时时间(秒)
                /// </summary>
                [NumValidate ("rpc.task.item.timeout.error", 5)]
                public int? TimeOut
                {
                        get;
                        set;
                }
                /// <summary>
                /// 允许重试次数
                /// </summary>
                [NumValidate ("rpc.task.item.retry.num.error", 0)]
                public int? RetryNum
                {
                        get;
                        set;
                }
                /// <summary>
                /// 执行失败的步骤
                /// </summary>
                [EnumValidate ("rpc.task.item.fail.setup.error", typeof (TaskSetup))]
                public TaskSetup FailSetup
                {
                        get;
                        set;
                }
                /// <summary>
                /// 失败后的步骤
                /// </summary>
                [NumValidate ("rpc.task.item.fail.setupNum.error", 1)]
                public int? FailNextSetup
                {
                        get;
                        set;
                }
                /// <summary>
                /// 成功步骤
                /// </summary>
                [EnumValidate ("rpc.task.item.success.setup.error", typeof (TaskSetup))]
                public TaskSetup SuccessSetup
                {
                        get;
                        set;
                }
                /// <summary>
                /// 成功后下一步骤
                /// </summary>
                public int? NextSetup
                {
                        get;
                        set;
                }
                /// <summary>
                /// 执行成功时是否写入日志
                /// </summary>
                public bool IsWriteLog
                {
                        get;
                        set;
                }
                /// <summary>
                /// 是否启用
                /// </summary>
                public bool IsEnable
                {
                        get;
                        set;
                }
        }
}
